<!DOCTYPE html>
<html>
<head>
    <title>支出</title>
    <include file="appapi@head"/>
    <link href='__STATIC__/appapi/css/record.css?t=3' type="text/css" rel="stylesheet">
</head>
<body>
     
     <div class="recordlist">
        <ul>
            <li class="title">
                <span class="span1">支出类型</span>
                <span class="span2">收礼用户</span>
                <span class="span3">{$site_info.name_coin}</span>
                <span class="span4">时间</span>
            </li>
            <volist name="list" id="v">
            <li>
                <span class="span1">{$v.actionname}</span>
                <span class="span2">{$v.user_nickname}</span>
                <span class="span3">{$v.totalcoin}</span>
                <span class="span4">{$v.addtime}</span>
            </li>
            </volist>
            <empty name="list">
            <div class="empty">
            </div>
            </empty>
        </ul>
     </div>
     <include file="appapi@footer"/>
     <include file="appapi@scripts"/>
      <script>
        var uid='{$uid}';
        var token='{$token}';
     	$(function(){
            function getlistmore(){
                $.ajax({
                    url:'/appapi/record/expendmore',
                    data:{'page':page,'uid':uid,'token':token},
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if(data.nums>0){
                                var nums=data.nums;
                                var list=data.list.data;
                                var html='';
                                for(var i=0;i<nums;i++){
                                    var v=list[i];
                                    html+='<li>\
                                            <span class="span1">'+v['actionname']+'</span>\
                                            <span class="span2">'+v['user_nickname']+'</span>\
                                            <span class="span3">'+v['totalcoin']+'</span>\
                                            <span class="span4">'+v['addtime']+'</span>\
                                        </li>';
                                }
                            
                            $(".recordlist ul").append(html);
                        }
                        
                        if(data.isscroll==1){
                            page++;
                            isscroll=true;
                        }
                    }
                })
            }
            

            var page=2; 
            var isscroll=true; 

            var scroll_obj=$(window);
            scroll_obj.scroll(function(){  
                    var srollPos = scroll_obj.scrollTop();    //滚动条距顶部距离(页面超出窗口的高度)  		
                    var totalheight = parseFloat(scroll_obj.height()) + parseFloat(srollPos);  
                    if(($(document).height()-50) <= totalheight  && isscroll) {  
                            isscroll=false;
                            getlistmore()
                    }  
            });  


        })
     </script>
</body>
</html>
